package com.yjt.fresh.adpater;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yjt.fresh.R;
import com.yjt.fresh.bean.BeanWalletDetail;

import java.util.List;

/**
 * 我的钱包明细
 * Created by mcc on 2018/6/10.
 */

public class AdpRvAtyWalletDetail extends BaseQuickAdapter<BeanWalletDetail, BaseViewHolder> {

    public AdpRvAtyWalletDetail(int layoutResId, @Nullable List<BeanWalletDetail> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanWalletDetail item) {
        switch (item.getREASON()){
            case 1:
                helper.setText(R.id.tvAppRecycleItemWalletDetailTitle, "订单收入");
                break;
            case 2:
                helper.setText(R.id.tvAppRecycleItemWalletDetailTitle, "充值收入");
                break;
            case 3:
                helper.setText(R.id.tvAppRecycleItemWalletDetailTitle, "提现支出");
                break;
            case 4:
                helper.setText(R.id.tvAppRecycleItemWalletDetailTitle, "售后退款");
                break;
            case 6:
                helper.setText(R.id.tvAppRecycleItemWalletDetailTitle, "取消订单");
                break;
            case 7:
                helper.setText(R.id.tvAppRecycleItemWalletDetailTitle, "充值赠送");
                break;
        }

        helper.setText(R.id.tvAppRecycleItemWalletDetailOrderNum, "订单号:"+item.getFLOW_NO());
        helper.setText(R.id.tvAppRecycleItemWalletDetailTime, item.getCREATE_TIME());
        if (item.getTYPE() == 1) {
            helper.setText(R.id.tvAppRecycleItemWalletDetailMoney, "-"+item.getMONEY());
        }else if (item.getTYPE() == 2){
            helper.setText(R.id.tvAppRecycleItemWalletDetailMoney, "+"+item.getMONEY());
        }
    }
}
